/**
 * Created by Admin on 2018/1/10.
 */
define(function(require,exports,module){
    var commonPaging = require("../common/commonPagingCq.js");
    var tpl=require("./tpl/patApplySearchTpl.html");
    require("../common/dialog.js");
    require("../common/My97DatePicker1/WdatePicker.js");
    require("../common/qy-template");
    require("../seajs-init");
    require("bootstrap");

    var p;
    setTimeout(function(){
        p=new commonPaging({
            htmlContainer: "#Js_page_content",
            pageContainer: "#Js_fs_paging",
            url: window.jkconfig.webapiurlv+"analysis/patentApply/applicantAnalysis",
            tpl:tpl,
            data:$("#searchForm").serialize()
        });
        p.init();
    },500);


    $(function(){
        var fatherBody = $(window.top.document.body);//找到父页面的body对象
        $("body").on("click",".btnSearch",function(){
            $("[name=patNum]").val($.trim($("[name=patNum]").val()));
            $("[name=patName]").val($.trim($("[name=patName]").val()));
            $("[name=applyPerson]").val($.trim($("[name=applyPerson]").val()));
            $("[name=agencyName]").val($.trim($("[name=agencyName]").val()));
            $("[name=address]").val($.trim($("[name=address]").val()));
            if($("#Js_fs_paging").css("display") == "block"){
                $("[name=pageNumber]").val(1);
                p.page.destroy && p.page.destroy();
                p=new commonPaging({
                    htmlContainer: "#Js_page_content",
                    pageContainer: "#Js_fs_paging",
                    url: window.jkconfig.webapiurlv+"analysis/patentApply/applicantAnalysis",
                    tpl:tpl,
                    data:$("#searchForm").serialize()
                });
                p.init();
            }else{
                p=new commonPaging({
                    htmlContainer: "#Js_page_content",
                    pageContainer: "#Js_fs_paging",
                    url: window.jkconfig.webapiurlv+"analysis/patentApply/applicantAnalysis",
                    tpl:tpl,
                    data:$("#searchForm").serialize()
                });
                p.init();
            }
        }).on("click",".btnAreaClassify",function() {
            fatherBody.find("#modal-area").show();
        })
    })
})